Fix epoch snapshot loading when first booting with ledger sync enabled #17912
+12
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will partially fix #17899, in particular the bit of incorrect code I noted in #17899 (comment). Actually, it may actually fix the whole thing, as I note here: #17899 (comment).
For context: when the daemon first boots up, it will try to load existing epoch ledger snapshots from disk. These snapshots might have been created without
--hardfork-mode auto
. If they were, then there will be no migrated database present alongside the stable one. This would causeexists_backing
to fail. The newexists_any_backing
checks for only the presence of the stable database. This allows the daemon to load a pre-existing snapshot, potentially by migrating the existing stable database.I haven't added a test for this yet, but I can confirm based on manual testing that this issue is now resolved. I'll open an issue with some ideas for ledger sync/auto hard fork component tests that we'll want to write.